<!DOCTYPE html>
<html>
  <head>
    <title>CindyScript command line</title>
    <meta charset="utf-8"/>
    <script src="../build/js/Cindy.js"></script>
    <script>
      var cindy = CindyJS({
        canvasname:"Cindy"
      });
      document.addEventListener("DOMContentLoaded", function() {
        var log, inp;
        log = document.getElementById("log");
        inp = document.getElementById("inp");
        function doit() {
          var i = inp.value;
          var t1 = document.createTextNode("> " + i);
          var p1 = document.createElement("p");
          var s = document.createElement("span");
          p1.appendChild(t1);
          s.appendChild(p1);
          log.appendChild(s);
          console.log(i);
          var o1 = cindy.evalcs(i);
          console.log(o1);
          var o2 = cindy.niceprint(o1);
          console.log(o2);
          var t2 = document.createTextNode("< " + o2);
          var p2 = document.createElement("p");
          p2.appendChild(t2);
          s.appendChild(p2);
          inp.value = "";
        }
        document.getElementById("do").onclick = doit;
      });
    </script>
  </head>
  <body>
    <span id="log"></span>
    <input id="inp" type="text">
    <input id="do" type="button" value="DO">
    <div id="Cindy" style="display:none; width:1px; height:1px;"></div>
  </body>
</html>
